<?php

namespace App\Http\Controllers\Api;

use App\Models\Talent;

class DashboardController extends Controller
{
    public function index()
    {
        $talent = Talent::all()->count();
        $a = Talent::where('interview_status', 1)->count(); // 待面试
        $b = Talent::whereIn('interview_status', [2])->count(); // 一面中
        $c = Talent::whereIn('interview_status', [5])->count(); // 待二面
        $d = Talent::whereIn('interview_status', [6])->count(); // 二面中
        $e = Talent::whereIn('interview_status', [9])->count(); // 待HR面
        $f = Talent::whereIn('interview_status', [10])->count(); // HR面中
        $g = Talent::where('interview_status', 13)->where('offer_status', 1)->count(); // 已录取

        return $this->response->array([
            'all' => $talent,
            'a' => $a,
            'b' => $b,
            'c' => $c,
            'd' => $d,
            'e' => $e,
            'f' => $f,
            'g' => $g,
        ]);
    }
}
